home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / syswit / config.frm (.txt) next >
Encoding:
Visual Basic Form  |  1995-05-08  |  6.3 KB  |  204 lines

  1. VERSION 2.00
  2. Begin Form Config 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Configure"
  6.    ClientHeight    =   2910
  7.    ClientLeft      =   2190
  8.    ClientTop       =   2310
  9.    ClientWidth     =   6180
  10.    ControlBox      =   0   'False
  11.    Height          =   3315
  12.    Left            =   2130
  13.    LinkMode        =   1  'Source
  14.    LinkTopic       =   "Form3"
  15.    MaxButton       =   0   'False
  16.    MinButton       =   0   'False
  17.    ScaleHeight     =   2910
  18.    ScaleWidth      =   6180
  19.    Top             =   1965
  20.    Width           =   6300
  21.    Begin TextBox Text2 
  22.       BackColor       =   &H00C0C0C0&
  23.       BorderStyle     =   0  'None
  24.       FontBold        =   0   'False
  25.       FontItalic      =   0   'False
  26.       FontName        =   "MS Sans Serif"
  27.       FontSize        =   8.25
  28.       FontStrikethru  =   0   'False
  29.       FontUnderline   =   0   'False
  30.       Height          =   255
  31.       Left            =   3790
  32.       TabIndex        =   3
  33.       Text            =   "Text2"
  34.       Top             =   2415
  35.       Width           =   2000
  36.    End
  37.    Begin TextBox Text1 
  38.       BackColor       =   &H00C0C0C0&
  39.       BorderStyle     =   0  'None
  40.       FontBold        =   0   'False
  41.       FontItalic      =   0   'False
  42.       FontName        =   "MS Sans Serif"
  43.       FontSize        =   8.25
  44.       FontStrikethru  =   0   'False
  45.       FontUnderline   =   0   'False
  46.       Height          =   255
  47.       Left            =   200
  48.       TabIndex        =   2
  49.       Text            =   "Text1"
  50.       Top             =   2415
  51.       Width           =   3375
  52.    End
  53.    Begin ComboBox Combo1 
  54.       BackColor       =   &H00C0C0C0&
  55.       FontBold        =   0   'False
  56.       FontItalic      =   0   'False
  57.       FontName        =   "MS Sans Serif"
  58.       FontSize        =   8.25
  59.       FontStrikethru  =   0   'False
  60.       FontUnderline   =   0   'False
  61.       Height          =   300
  62.       Left            =   1920
  63.       Style           =   2  'Dropdown List
  64.       TabIndex        =   1
  65.       Top             =   1170
  66.       Width           =   3615
  67.    End
  68.    Begin CommandButton Command1 
  69.       Cancel          =   -1  'True
  70.       Caption         =   "Cancel"
  71.       Height          =   375
  72.       Index           =   1
  73.       Left            =   4965
  74.       TabIndex        =   5
  75.       Top             =   675
  76.       Width           =   1095
  77.    End
  78.    Begin CommandButton Command1 
  79.       Caption         =   "Okay"
  80.       Default         =   -1  'True
  81.       Height          =   375
  82.       Index           =   0
  83.       Left            =   4965
  84.       TabIndex        =   4
  85.       Top             =   165
  86.       Width           =   1095
  87.    End
  88.    Begin Label Label3 
  89.       BackColor       =   &H00C0C0C0&
  90.       Caption         =   "Configuration Name                                   System File"
  91.       Height          =   195
  92.       Left            =   200
  93.       TabIndex        =   7
  94.       Top             =   2025
  95.       Width           =   5655
  96.    End
  97.    Begin Label Label2 
  98.       BackColor       =   &H00C0C0C0&
  99.       Caption         =   "Edit configuration:"
  100.       Height          =   255
  101.       Left            =   200
  102.       TabIndex        =   6
  103.       Top             =   1200
  104.       Width           =   1635
  105.    End
  106.    Begin Label Label4 
  107.       BackColor       =   &H00C0C0C0&
  108.       Caption         =   " "
  109.       Height          =   255
  110.       Left            =   1845
  111.       TabIndex        =   8
  112.       Top             =   255
  113.       Width           =   1530
  114.    End
  115.    Begin Label Label1 
  116.       BackColor       =   &H00C0C0C0&
  117.       Caption         =   "Windows directory:"
  118.       Height          =   255
  119.       Index           =   0
  120.       Left            =   200
  121.       TabIndex        =   0
  122.       Top             =   255
  123.       Width           =   1710
  124.    End
  125. DefInt A-Z
  126. Dim ReadString As String * 255
  127. Function CheckLen ()
  128. CheckLen = False
  129. If Len(Text2.Text) > 12 Then MsgBox "Not a valid filename. You must specify a legal DOS file name for this field. For example: SYSTEM01.VGA", 0, "File Name Too Long": Text2.SetFocus : CheckLen = True
  130. End Function
  131. Sub Combo1_Click ()
  132. Text1.Text = ConfigName(Combo1.ListIndex + 1)
  133. Text2.Text = ConfigFile(Combo1.ListIndex + 1)
  134. End Sub
  135. Sub Command1_Click (Index As Integer)
  136. HandOff = True
  137. If CheckLen() = True Then Exit Sub
  138. If WASRECORDCHANGED = False Then Config.Hide : Exit Sub
  139. If Index = 0 Then WritProf
  140. If Index = 1 Then ReadProf: Reload: HandOff = False
  141. WASRECORDCHANGED = False
  142. Config.Hide
  143. End Sub
  144. Sub Form_Load ()
  145. Combo1.AddItem ConfigName(1)
  146. Combo1.AddItem ConfigName(2)
  147. Combo1.AddItem ConfigName(3)
  148. Combo1.AddItem ConfigName(4)
  149. Combo1.AddItem ConfigName(5)
  150. WASRECORDCHANGED = False
  151. End Sub
  152. Sub Form_Paint ()
  153. Autoredraw = True
  154. Call Frame(Config, Text1.Left - 30, Text1.top - 30, Text1.Height + 60, Text1.Width + 60)
  155. Call Frame(Config, Text2.Left - 30, Text2.top - 30, Text2.Height + 60, Text2.Width + 60)
  156. Call Frame(Config, 60, Label3.top + Label3.Height + 30, 20, Config.Width - 300)
  157. Call Frame(Config, 60, Label3.top - 60, 20, Config.Width - 300)
  158. Call Frame2(Config, 60, 60, Config.Height - 560, Config.Width - 284)
  159. Call Frame(Config, Combo1.Left - 5, Combo1.top - 5, Combo1.Height + 10, Combo1.Width + 10)
  160. End Sub
  161. Sub Reload ()
  162. Combo1.RemoveItem 0
  163. Combo1.RemoveItem 0
  164. Combo1.RemoveItem 0
  165. Combo1.RemoveItem 0
  166. Combo1.RemoveItem 0
  167. Combo1.AddItem ConfigName(1)
  168. Combo1.AddItem ConfigName(2)
  169. Combo1.AddItem ConfigName(3)
  170. Combo1.AddItem ConfigName(4)
  171. Combo1.AddItem ConfigName(5)
  172. End Sub
  173. Sub Text1_GotFocus ()
  174. Text1.SelStart = 0&
  175. Text1.SelLength = Len(Text1.Text)
  176. End Sub
  177. Sub Text1_KeyPress (keyascii As Integer)
  178. WASRECORDCHANGED = True
  179. End Sub
  180. Sub Text1_LostFocus ()
  181. If Text1.Text = Combo1.Text Then Exit Sub
  182. WASRECORDCHANGED = True
  183. If Config.VISIBLE = False Then Exit Sub
  184. x = Combo1.ListIndex
  185. Combo1.RemoveItem x
  186. Text$ = Text1.Text
  187. ConfigName(x + 1) = Text$
  188. Combo1.AddItem Text$, x
  189. Combo1.ListIndex = x
  190. Combo1.Refresh
  191. End Sub
  192. Sub Text2_GotFocus ()
  193. Text2.SelStart = 0&
  194. Text2.SelLength = Len(Text2.Text)
  195. End Sub
  196. Sub Text2_LostFocus ()
  197. x = Combo1.ListIndex + 1
  198. Text$ = Text2.Text
  199. If CheckLen() = True Then Exit Sub
  200. If Text$ = ConfigFile(x) Then Exit Sub
  201. WASRECORDCHANGED = True
  202. ConfigFile(x) = Text$
  203. End Sub
  204.